Consumer electronic devices commonly use infrared (IR) remote control to receive input from a user. A remote controller transmits modulated infrared signals carrying predefined codes that indicate functions that the electronic device is to perform. The device demodulates, samples and decodes the signals in order to carry out the desired functions. There are many different protocols in use, and different manufacturers commonly use different protocols and different data rates for transmission. Common protocols include the RC-5 and RC-6 protocols (developed by Philips) and the NEC protocol (developed by Nippon Electric Corporation). According to these protocols, the transmitter emits a train of IR pulses at a selected carrier frequency, and the train is modulated on and off in accordance with the transmitted codes, as dictated by the protocol, at a selected baud rate.
U.S. Patent Application Publication US 2004/0208182, whose disclosure is incorporated herein by reference, describes a format-independent consumer IR transceiver. The transceiver determines the carrier frequency of an IR input by counting IR pulses. The applicants point out that typical IR carrier frequencies can be as high as 455 kHz or higher, so that sampling of such a signal for direct determination of the carrier frequency would need to take place at approximately 1 MHz or higher. A sampling apparatus capable of sampling at such a rate is relatively expensive, and is therefore disfavored in low-cost IR devices. Instead, the applicants suggest a method of sampling a hardware counter that counts the number of pulses contained in the IR signal, and then performs an algorithm that determines the carrier frequency from the counted pulses and number of samples. The counter is sampled at a slower frequency than the IR input of the transceiver, such as at 16 kHz. The pulse count is used in a run-length encoding process to create values of an encoded envelope. The pulse count and run-length encoding information are sent to a microcontroller, which calculates the carrier frequency.